# 导入pytesseract库
import pytesseract
# 导入Image库
from PIL import Image

# 指定tesseract.exe所在的路径
pytesseract.pytesseract.tesseract_cmd = r'D:\Program Files (x86)\Tesseract-OCR\tesseract.exe'

# 打开图片
image = Image.open("33.jpg")
# 调用image_to_string将图片转换为文字
text = pytesseract.image_to_string(image,lang='chi_sim')
print(text)